import React, { Component } from 'react';
import { View,Text, Button,Dimensions } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import NavigationService from '../NavigationService';
const SCREEN_WIDTH = Dimensions.get('window').width;

export default Tab = ({index})=>{

    return (
        <View 
            style={{
                width:SCREEN_WIDTH,
                flexDirection:'row',
                alignItems:'center',
                justifyContent:'space-around',
                borderTopColor:'#FFF',
                borderTopWidth:1,
                backgroundColor:'#0003',
                position: 'absolute',
                bottom: 0,
                right: 0,
                left:0,
            }}
            >
            <Button title='首页' color={index==0?'#fff':'#6e6e6e'} onPress={()=>{NavigationService.navigate('Home')}}/>
            <Icon name="ios-add-circle" size={26} color='red' onPress={()=>{NavigationService.navigate('Post')}}/>
            <Button title='我的' color={index==2?'#fff':'#6e6e6e'} onPress={()=>{NavigationService.navigate('Mine');}}/>
        </View>
    );
}